Skip to content

fix(ci): build and restore the Playwright golden fixture on MySQL - #36404

Merged
shrabantipaul-collate merged 6 commits into
mainfrom
shrabantipaul-collate/openmetadata-actions-failing-fix
Oct 29, 2026
Merged

shrabantipaul-collate merged 6 commits into
mainfrom
shrabantipaul-collate/openmetadata-actions-failing-fix

Conversation

@shrabantipaul-collate

@shrabantipaul-collate shrabantipaul-collate commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes the failing MySQL Playwright E2E (release branch) run: every 2.1 dispatch dies in prepare-playwright-fixture with Error: No such object: openmetadata_postgresql (e.g. run 40636905856).

Since #31628 the MySQL run goes through playwright-e2e-reusable.yml, but the golden-fixture pipeline it uses (#30310) only knew PostgreSQL + OpenSearch: the builder snapshots openmetadata_postgresql/openmetadata_opensearch, the validator requires ./postgres/PG_VERSION, and the shard launcher starts docker-compose-postgres.yml with the PostgreSQL JDBC driver and SEARCH_TYPE=opensearch. The MySQL stack (docker/development/docker-compose.yml) runs MySQL + Elasticsearch, so the snapshot step fails.

A second, silent problem: the golden-fixture cache key did not include the database. Whenever a PostgreSQL fixture with the same fingerprint was cached, a "MySQL" run restored it and actually tested PostgreSQL + OpenSearch.

Type of change:

  • Bug fix

High-level design:

  • .github/scripts/playwright_fixture_profile.sh (new, sourced) maps a database to its stack: compose file, fast compose override, service/container names, data paths, base image Dockerfile, layout markers, server JDBC settings, Airflow DB scheme and SEARCH_TYPE. postgresql → PostgreSQL + OpenSearch, mysql → MySQL + Elasticsearch. load_playwright_fixture_profile_from_manifest reads the fixture's database and rejects a fixture seeded on another engine when PLAYWRIGHT_DATABASE is set.
  • Fixture manifest v3 records database, databaseImage, searchImage (replacing postgresImage/opensearchImage); the archive uses generic database/ and search/ directories. The database image is the digest of the FROM image of the stack's Dockerfile (postgres:15 / mysql:8.0), as before for PostgreSQL.
  • docker/development/docker-compose-playwright-fast-mysql.yml (new) restores MySQL (keeps --sort_buffer_size=10M, drops binlog/flush durability for the disposable clone) and Elasticsearch (2 GiB heap) from the /dev/shm snapshot. The PostgreSQL override uses the same generic PW_DATABASE_*/PW_SEARCH_* variables.
  • Launcher / stop script pick everything from the profile and export PW_COMPOSE_FILE, PW_FAST_COMPOSE_FILE, PW_DATABASE_SERVICE, PW_SEARCH_SERVICE for cleanup and diagnostics.
  • Workflow (playwright-e2e-reusable.yml): top-level PLAYWRIGHT_DATABASE: ${{ inputs.database }}, golden-fixture cache key playwright-golden-fixture-v2-${{ inputs.database }}-…, shard diagnostics read the launcher's exports (with PostgreSQL fallbacks for release branches whose launcher predates them). Comment in populate-playwright-caches.yml updated accordingly.
  • Image pulls outside the 5m restore budget: pull_playwright_fixture_images.sh (moved out of the launcher) now also runs as its own step in setup-openmetadata-test-environment with a 15m timeout, reading the image digests from the fixture manifest. On the first MySQL run, 4/34 shards were killed by the 5m restore timeout while pulling docker.elastic.co/elasticsearch:9.3.0 (4–5 min with ~40 shards pulling at once); the same budget previously killed a PostgreSQL shard on an OpenSearch pull (run 34826046448). The launcher calls the same script, so its pulls are cache hits.
  • Fingerprint: MySQL stack files (docker-compose.yml, the new override, docker/mysql/, the profile helper) join the fixture inputs.

Rollout: the manifest version, fixture key and fingerprint all change, so the first run of each pipeline rebuilds its fixture once. Release branches need a backport — a dispatch with branch: 2.1 checks out 2.1's scripts; I'll open the 2.1 backport after this merges.

Alternatives rejected: seeding every MySQL shard from scratch (restructures the PR-gating shard job and slows every shard); restoring the pre-#31628 standalone MySQL workflow (re-introduces the drift #31628 removed).

Tests:

Use cases covered

  • MySQL release-branch run builds a MySQL + Elasticsearch golden fixture and shards restore it.
  • A fixture seeded on PostgreSQL is rejected by a MySQL run (and vice versa), and the cache key keeps them apart.
  • PostgreSQL PR pipeline behaves as before (same stack, settings and images).

Unit tests

  • Added to .github/scripts/tests/test_playwright_cache_assets.py:
    • test_fixture_profile_matches_the_seeded_and_fast_compose_stacks[postgresql|mysql] — profile container names / data paths / images agree with both compose stacks (fails on the original bug: a wrong container name for MySQL).
    • test_fixture_validator_accepts_a_fixture_seeded_on_the_requested_database[mysql|postgresql] — runs validate_playwright_fixture.sh on a real .tar.zst fixture.
    • test_fixture_validator_rejects_a_fixture_seeded_on_another_database
    • test_fixture_validator_requires_the_search_layout_of_the_fixture_database
    • test_golden_fixture_cache_is_scoped_by_database
  • Updated test_playwright_startup_diagnostics.py for the renamed stop-script variables.
  • python -m pytest .github/scripts/tests/ → 335 passed, 5 failed. The 5 failures are pre-existing and fail identically on a clean origin/main checkout (test_unavailable_first_attempt_evidence_never_becomes_a_pass[False], test_basic_project_excludes_dedicated_state_specs, test_search_impact_mapping_includes_ingestion_project_for_schema_search, test_summary_reconciles_results_and_evaluates_performance_independently, test_retry_policy_is_one_everywhere_during_the_flake_week).
  • bash -n on all changed scripts; docker compose config on the merged MySQL and PostgreSQL fast stacks (bind mounts replace base volumes, base healthchecks inherited, pinned image used with --no-build).

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI or spec changes). End-to-end verification is the MySQL Playwright workflow dispatched on this branch (full_suite=true):
    • run 40647360050 on 82516d8: MySQL golden fixture built ✅; 30/34 shards (incl. Airflow-on-MySQL ingestion lanes) passed; 4 killed by the 5m restore timeout while pulling the Elasticsearch image → fixed in d08b91b/9a81c13.
    • run 40651993039 on 9a81c13 (PR head): success, 34/34 shards. Environment setup per shard: min 76s, median 95s, max 309s (the max would have exceeded the old 5m pull+startup budget).

Manual testing performed

  1. Reproduced the failure from the 2.1 run log: create_playwright_fixture.sh → docker inspect openmetadata_postgresql on the MySQL stack.
  2. Rendered docker compose -f docker/development/docker-compose.yml -f docker/development/docker-compose-playwright-fast-mysql.yml config with fixture env vars and checked image, command, volumes, healthchecks.
  3. Dispatched mysql-nightly-e2e.yml on this branch twice (links above).
  4. Checked tar --zstd --occurrence=1 -xOf <fixture> ./fixture-manifest.json | jq under GNU tar 1.35 (Ubuntu 24.04, as on runners).

UI screen recording:

Not applicable — CI-only change.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation> — test/CI fix, no issue (skip-pr-checks).

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above. — test/CI fix, see above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: not applicable.

  • For a UI feature or feature task: not applicable.

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: reviewed f989c7d, 82516d8, d08b91b against REVIEW.md — no 🔴 (9a81c13 applies the last nit, --occurrence=1). Nits fixed: release-branch diagnostics fallbacks, shared manifest→profile check (now covered by the validator tests), stale cache-key comment. Answered: per-database fixture fingerprint not split — MySQL-only compose edits are rare (~2 in 90 days) and a split would thread the database through every --kind fixture call site.

  • Decision check: no durable cross-component decision; the fixture manifest is produced and consumed only by these scripts.

  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking improvement to report fixture-read errors in the image-pull step.

Findings

  1. P2 Fixture read errors are hidden ▶

Summary

Adds MySQL and Elasticsearch support to the shared Playwright fixture pipeline.

  • Playwright fixtures carry the database and search engine they were seeded with.
  • Playwright shards restore and run the stack selected by the fixture.
  • Fixture images download before the shard restore time limit starts.

Acknowledged choices from shrabantipaul-collate: release branches need a separate backport; database-specific fingerprints are intentionally deferred because MySQL-only changes are rare and splitting them would affect every fixture-key caller; the manifest remains an internal script contract.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Requested database] --> B[Shared fixture profile]
  B --> C[Seed matching database and search stack]
  C --> D[Archive data and version 3 manifest]
  D --> E[Cache under database-specific key]
  E --> F[Reject a different database]
  F --> G[Pull recorded images]
  G --> H[Restore data and start matching services]
  H --> I[Start server and optional Airflow]
Loading

Reviews (1) · Last reviewed commit: "fix(ci): stop reading the fixture once i..." · Reviewed by Greptile

Shrabanti Paul added 2 commits October 28, 2026 12:21
The MySQL release-branch Playwright run goes through the shared reusable
workflow, but the golden-fixture builder, validator and fast-environment
launcher only knew the PostgreSQL + OpenSearch stack. Every MySQL fixture
rebuild failed with `No such object: openmetadata_postgresql`, and because
the fixture cache key ignored the database, a MySQL run could restore a
PostgreSQL fixture and silently test PostgreSQL instead.

- playwright_fixture_profile.sh maps each database to its compose stack,
  containers, data paths and server/Airflow settings (PostgreSQL with
  OpenSearch, MySQL with Elasticsearch).
- The fixture manifest (v3) records the database and generic
  databaseImage/searchImage digests; the validator and launcher reject a
  fixture seeded on a different database.
- docker-compose-playwright-fast-mysql.yml restores MySQL and
  Elasticsearch from the snapshot.
- The golden-fixture cache key includes the database.
@shrabantipaul-collate shrabantipaul-collate added the skip-pr-checks Bypass PR metadata validation check label Oct 28, 2026
@github-actions github-actions Bot added the UI UI specific issues label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

…/openmetadata-actions-failing-fix

# Conflicts:
#	.github/scripts/tests/test_playwright_cache_assets.py
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

… the fixture decisions

The pull step read the manifest through process substitution, whose exit
status is lost, so a tar or jq failure skipped the pull silently. Assign the
manifest and require both images instead.

Add decision records for the per-database golden-fixture contract and for
pulling fast-mode images outside the 5m startup budget.
@gitar-bot

gitar-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🟡 Medium risk · Adding MySQL/Elasticsearch fixture creation and restoration changes CI database setup; profile or image mismatches could fail shards or test against an unintended stack.

Fixes the MySQL Playwright golden-fixture pipeline by adding a database-specific fixture profile, MySQL and Elasticsearch stack support, a database-scoped cache key, and a separate 15m image-pull step outside the 5m restore budget. Resolved the missing decision-record findings for the per-database fixture contract and the new image-pull budget. No open issues found.

✅ 2 closed
✅ Quality: Per-database golden-fixture contract has no decision record

📄 .github/scripts/playwright_fixture_profile.sh:19-33 📄 .github/scripts/create_playwright_fixture.sh:118-132 📄 .github/workflows/playwright-e2e-reusable.yml:936 📄 .github/workflows/playwright-e2e-reusable.yml:1283 📄 .github/scripts/playwright_cache_fingerprint.py:94-100
This PR adds a contract that several files have to agree on, and nothing in docs/decisions/ records it (no record mentions the golden fixture or fixture-manifest). The contract has three parts:

  • Manifest v3 carries a database field plus the engine-neutral databaseImage/searchImage fields.
  • The cache key format is now playwright-golden-fixture-v2-<database>-<os>-<arch>-<fingerprint>. populate-playwright-caches.yml and the restore/save steps all depend on it.
  • postgresql pairs with OpenSearch and mysql pairs with Elasticsearch.

The description also states a rule that exists only in prose: "The fixture fingerprint is not split per database, because MySQL-only compose edits are rare." The repo squash-merges, so that reasoning will be lost.

The record would say something like: "A Playwright golden fixture records the database it was seeded on (manifest database). Its cache key carries that database. The validator and fast launcher reject a fixture seeded on a different database than PLAYWRIGHT_DATABASE. PostgreSQL fixtures pair with OpenSearch and MySQL fixtures with Elasticsearch, as defined in playwright_fixture_profile.sh. The fixture fingerprint is shared across databases, so a MySQL-only compose edit also invalidates the PostgreSQL fixture."

✅ Quality: New 15m image-pull budget outside the 5m restore has no record

📄 .github/actions/setup-openmetadata-test-environment/action.yml:226-240 📄 .github/scripts/start_playwright_fast_environment.sh:197-206
This commit sets a new timeout: a separate step gets 15 minutes to pull the fast-environment images, and the 5m restore budget no longer covers registry pulls. That is a judgment call. The commit message and the step comment give the reason (Elasticsearch from docker.elastic.co took 4-5 min when about 40 MySQL shards pulled at once). Nothing in docs/decisions/ says it, and the existing per-database fixture finding does not cover this budget.

The record would say: "Fast-mode Playwright setup pulls the fixture's database and search images in their own step with a 15-minute budget, before the 5-minute restore/startup budget. Registry pull time is never counted against startup." Without the record, a later change could fold the pull back into the restore step, or trim the 15m, and bring back the shard failures this commit fixes.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants